package
	{
	import flash.display.MovieClip;
	import flash.text.*;
	import flash.events.*;
	
	public class InventorySlot extends MovieClip
		{
		var quantity:int;
		var item:Item;
		
		public function InventorySlot()
			{
			this.quantity = 0;
			this.item = null;
			this.quantityDisplay.text = "";
			}
		
		public function addItem(item:Item)
			{
			if (this.quantity == 0)
				{
				this.addChild(item.itemIcon);
				item.itemIcon.gotoAndStop("icon");
				this.item = item;
				}
			this.quantity++;
			quantityDisplay.text = String(this.quantity);
			}
		
		public function removeItem()
			{
			this.quantity--;
			if (this.quantity > 0)
				quantityDisplay.text = String(this.quantity);
			else
				{
				quantityDisplay.text = "";
				this.removeChild(this.item.itemIcon);
				this.item = null;
				}
			}
		}
	}